package com.wushijia.net;

import java.io.DataInputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * description:
 * @author yang
 * @date 2018/1/8 21:40
 */
public class TcpServer {

  public static void main(String[] args) throws IOException{
    System.out.println("test");
    ServerSocket serverSocket = new ServerSocket(6666);
    Socket socket = serverSocket.accept();
    DataInputStream dataInputStream = new DataInputStream(socket.getInputStream());
    System.out.println(dataInputStream.readUTF());
    dataInputStream.close();
    socket.close();
  }
}
